<?php
/**
 * Each engineer has a duty to keep the code elegant
 * Author @liuhuiwu<13750088090@sina.cn>
 * 
 */
$appid = 'wx5fdcb8178b872984';
$redirect_uri = "http://zhibo.gdgccj.com/include/wechat_getcode.php";
$redirect_uri = urlencode($redirect_uri);
$scope = "snsapi_login";
//-------生成唯一随机串防CSRF攻击
$state = md5(uniqid(rand(), TRUE));
$url = "https://open.weixin.qq.com/connect/qrconnect?appid=".$appid."&redirect_uri=".$redirect_uri."&response_type=code&scope=".$scope."&state=".$state."#wechat_redirect";
header("location:" . $url);